smartbuck6 2.2.0
Loading...
Searching...
No Matches
smartbuck6.h File Reference

This file contains API for Smart Buck 6 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  smartbuck6_status_t
 Smart Buck 6 Click status object. More...
struct  smartbuck6_t
 Smart Buck 6 Click context object. More...
struct  smartbuck6_cfg_t
 Smart Buck 6 Click configuration object. More...

Macros

#define SMARTBUCK6_REG_STATUS_0   0x00
 Smart Buck 6 register list.
#define SMARTBUCK6_REG_STATUS_1   0x01
#define SMARTBUCK6_REG_BUCK_A_CURR_PWR_METER   0x02
#define SMARTBUCK6_REG_BUCK_B_CURR_PWR_METER   0x03
#define SMARTBUCK6_REG_BUCK_C_CURR_PWR_METER   0x04
#define SMARTBUCK6_REG_BUCKX_VOLTAGE   0x06
#define SMARTBUCK6_REG_CLEAR_0   0x07
#define SMARTBUCK6_REG_CLEAR_1   0x08
#define SMARTBUCK6_REG_MASK_0   0x09
#define SMARTBUCK6_REG_MASK_1   0x0A
#define SMARTBUCK6_REG_REMOTE   0x0B
#define SMARTBUCK6_REG_BUCKX_CTRL   0x0C
#define SMARTBUCK6_REG_PG   0x0D
#define SMARTBUCK6_REG_DISCHARGE_R   0x0E
#define SMARTBUCK6_REG_SW_FREQ   0x0F
#define SMARTBUCK6_REG_MONITOR_EN   0x10
#define SMARTBUCK6_REG_SOFT_STOP_EN   0x11
#define SMARTBUCK6_REG_SOFT_STOP   0x12
#define SMARTBUCK6_REG_SOFT_START   0x13
#define SMARTBUCK6_REG_PROTECT   0x14
#define SMARTBUCK6_REG_BUCK_A_VOUT   0x15
#define SMARTBUCK6_REG_BUCK_B_VOUT   0x16
#define SMARTBUCK6_REG_BUCK_C_VOUT   0x17
#define SMARTBUCK6_REG_PON_CONFIG_0   0x19
#define SMARTBUCK6_REG_PON_CONFIG_1   0x1A
#define SMARTBUCK6_REG_PON_CONFIG_2   0x1B
#define SMARTBUCK6_REG_PON_CONFIG_3   0x1C
#define SMARTBUCK6_REG_PON_OFF_DELAY0   0x1D
#define SMARTBUCK6_REG_PON_SEQ_DELAY_1_2   0x1E
#define SMARTBUCK6_REG_PON_SEQ_DELAY_3_PG   0x1F
#define SMARTBUCK6_REG_POFF_SEQ_CONFIG_0   0x20
#define SMARTBUCK6_REG_POFF_SEQ_CONFIG_1   0x21
#define SMARTBUCK6_REG_POFF_SEQ_CONFIG_2   0x22
#define SMARTBUCK6_REG_POFF_SEQ_CONFIG_3   0x23
#define SMARTBUCK6_REG_ADC_TEMP   0x24
#define SMARTBUCK6_REG_VOUT_RANGE_SEL   0x25
#define SMARTBUCK6_REG_OC_STATUS_CLEAR   0x2A
#define SMARTBUCK6_REG_MTP_AUTO   0x30
#define SMARTBUCK6_REG_PART_ID   0x31
#define SMARTBUCK6_REG_CODE_ID   0x35
#define SMARTBUCK6_REG_CODE_VERSION   0x36
#define SMARTBUCK6_REG_ACTIVE_POS_EN_A_B   0x71
#define SMARTBUCK6_REG_I2C_ADDRESS   0x73
#define SMARTBUCK6_REG_ACTIVE_POS_EN_C   0x79
#define SMARTBUCK6_REG_VIN_OV   0x90
#define SMARTBUCK6_REG_VIN_UVLO   0xAF
#define SMARTBUCK6_STATUS_0_OVER_TEMP_STATUS   0x40
 Smart Buck 6 STATUS_0 register setting.
#define SMARTBUCK6_STATUS_0_BUCK_A_PWR_NOT_GOOD   0x20
#define SMARTBUCK6_STATUS_0_BUCK_B_PWR_NOT_GOOD   0x10
#define SMARTBUCK6_STATUS_0_BUCK_C_PWR_NOT_GOOD   0x08
#define SMARTBUCK6_STATUS_0_VIN_OV   0x02
#define SMARTBUCK6_STATUS_1_BUCK_A_OV   0x80
 Smart Buck 6 STATUS_1 register setting.
#define SMARTBUCK6_STATUS_1_BUCK_B_OV   0x40
#define SMARTBUCK6_STATUS_1_BUCK_C_OV   0x20
#define SMARTBUCK6_STATUS_1_BUCK_A_UV   0x08
#define SMARTBUCK6_STATUS_1_BUCK_B_UV   0x04
#define SMARTBUCK6_STATUS_1_BUCK_C_UV   0x02
#define SMARTBUCK6_CLEAR_0_BUCK_A_PWR_NOT_GOOD   0x20
 Smart Buck 6 CLEAR_0 register setting.
#define SMARTBUCK6_CLEAR_0_BUCK_B_PWR_NOT_GOOD   0x10
#define SMARTBUCK6_CLEAR_0_BUCK_C_PWR_NOT_GOOD   0x08
#define SMARTBUCK6_CLEAR_0_VIN_OVP   0x02
#define SMARTBUCK6_CLEAR_0_GLOBAL   0x01
#define SMARTBUCK6_CLEAR_1_BUCK_A_OV   0x80
 Smart Buck 6 CLEAR_1 register setting.
#define SMARTBUCK6_CLEAR_1_BUCK_B_OV   0x40
#define SMARTBUCK6_CLEAR_1_BUCK_C_OV   0x20
#define SMARTBUCK6_CLEAR_1_BUCK_A_UV   0x08
#define SMARTBUCK6_CLEAR_1_BUCK_B_UV   0x04
#define SMARTBUCK6_CLEAR_1_BUCK_C_UV   0x02
#define SMARTBUCK6_OC_STATUS_CLEAR_BUCK_A_OC   0x80
 Smart Buck 6 OC_STATUS_CLEAR register setting.
#define SMARTBUCK6_OC_STATUS_CLEAR_BUCK_B_OC   0x40
#define SMARTBUCK6_OC_STATUS_CLEAR_BUCK_C_OC   0x20
#define SMARTBUCK6_OC_STATUS_BUCK_A_OC   0x08
#define SMARTBUCK6_OC_STATUS_BUCK_B_OC   0x04
#define SMARTBUCK6_OC_STATUS_BUCK_C_OC   0x02
#define SMARTBUCK6_BUCKX_CTRL_BUCK_C_EN   0x20
 Smart Buck 6 BUCKX_CTRL register setting.
#define SMARTBUCK6_BUCKX_CTRL_BUCK_B_EN   0x40
#define SMARTBUCK6_BUCKX_CTRL_BUCK_A_EN   0x80
#define SMARTBUCK6_BUCKX_CTRL_BUCK_X_EN_MASK   0xE0
#define SMARTBUCK6_BUCKX_CTRL_PWM_BUCK_C_AUTO   0x02
#define SMARTBUCK6_BUCKX_CTRL_PWM_BUCK_B_AUTO   0x04
#define SMARTBUCK6_BUCKX_CTRL_PWM_BUCK_A_AUTO   0x08
#define SMARTBUCK6_VOUT_RANGE_SEL_BUCK_C_15MV   0x02
 Smart Buck 6 VOUT_RANGE_SEL register setting.
#define SMARTBUCK6_VOUT_RANGE_SEL_BUCK_B_15MV   0x04
#define SMARTBUCK6_VOUT_RANGE_SEL_BUCK_A_15MV   0x08
#define SMARTBUCK6_VOUT_RANGE_SEL_BUCK_X_MASK   0x0E
#define SMARTBUCK6_PART_ID   0x13
 Smart Buck 6 PART_ID register setting.
#define SMARTBUCK6_BUCK_C   0x01
 Smart Buck 6 buck selection setting.
#define SMARTBUCK6_BUCK_B   0x02
#define SMARTBUCK6_BUCK_A   0x04
#define SMARTBUCK6_BUCK_ALL   0x07
#define SMARTBUCK6_VOUT_MV_MIN   400
 Smart Buck 6 vout setting.
#define SMARTBUCK6_VOUT_MV_MAX   3600
#define SMARTBUCK6_VOUT_MV_STEP_THRESHOLD   1200
#define SMARTBUCK6_VOUT_MV_STEP_10MV   10
#define SMARTBUCK6_VOUT_MV_STEP_15MV   15
#define SMARTBUCK6_IOUT_RES_MV   125
 Smart Buck 6 current resolution setting.
#define SMARTBUCK6_DEVICE_ADDRESS_A2A1_11   0x07
 Smart Buck 6 device address setting.
#define SMARTBUCK6_DEVICE_ADDRESS_A2A1_ZZ   0x08
#define SMARTBUCK6_DEVICE_ADDRESS_A2A1_00   0x09
#define SMARTBUCK6_DEVICE_ADDRESS_A2A1_0Z   0x0A
#define SMARTBUCK6_DEVICE_ADDRESS_A2A1_01   0x0B
#define SMARTBUCK6_DEVICE_ADDRESS_A2A1_Z0   0x0C
#define SMARTBUCK6_DEVICE_ADDRESS_A2A1_Z1   0x0D
#define SMARTBUCK6_DEVICE_ADDRESS_A2A1_10   0x0E
#define SMARTBUCK6_DEVICE_ADDRESS_A2A1_1Z   0x0F
#define SMARTBUCK6_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.

Enumerations

enum  smartbuck6_return_value_t { SMARTBUCK6_OK = 0 , SMARTBUCK6_ERROR = -1 }
 Smart Buck 6 Click return value data. More...

Functions

void smartbuck6_cfg_setup (smartbuck6_cfg_t *cfg)
 Smart Buck 6 configuration object setup function.
err_t smartbuck6_init (smartbuck6_t *ctx, smartbuck6_cfg_t *cfg)
 Smart Buck 6 initialization function.
err_t smartbuck6_default_cfg (smartbuck6_t *ctx)
 Smart Buck 6 default configuration function.
err_t smartbuck6_write_reg (smartbuck6_t *ctx, uint8_t reg, uint8_t data_in)
 Smart Buck 6 write register function.
err_t smartbuck6_read_reg (smartbuck6_t *ctx, uint8_t reg, uint8_t *data_out)
 Smart Buck 6 read register function.
void smartbuck6_enable_device (smartbuck6_t *ctx)
 Smart Buck 6 enable device function.
void smartbuck6_disable_device (smartbuck6_t *ctx)
 Smart Buck 6 disable device function.
uint8_t smartbuck6_get_pg_pin (smartbuck6_t *ctx)
 Smart Buck 6 get power-good pin function.
err_t smartbuck6_check_com (smartbuck6_t *ctx)
 Smart Buck 6 check communication function.
err_t smartbuck6_read_status (smartbuck6_t *ctx, smartbuck6_status_t *status)
 Smart Buck 6 read status registers function.
err_t smartbuck6_clear_status (smartbuck6_t *ctx)
 Smart Buck 6 clear status flags function.
err_t smartbuck6_enable_buck (smartbuck6_t *ctx, uint8_t buck_sel)
 Smart Buck 6 enable selected buck function.
err_t smartbuck6_disable_buck (smartbuck6_t *ctx, uint8_t buck_sel)
 Smart Buck 6 disable selected buck function.
err_t smartbuck6_set_buck_vout (smartbuck6_t *ctx, uint8_t buck_sel, uint16_t vout_mv)
 Smart Buck 6 set output voltage function.
err_t smartbuck6_read_buck_current (smartbuck6_t *ctx, uint8_t buck_sel, uint16_t *current_ma)
 Smart Buck 6 read buck output current function.

Detailed Description

This file contains API for Smart Buck 6 Click Driver.

Enumeration Type Documentation

◆ smartbuck6_return_value_t

Smart Buck 6 Click return value data.

Predefined enum values for driver return values.

Enumerator
SMARTBUCK6_OK 
SMARTBUCK6_ERROR